package com.izhar.answeringmachine.utils;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.xml.transform.Result;

/**
 * 用于传递消息的工具类
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class ResultData {

    //状态
    private String status;

    //具体信息
    private String msg;

    //数据
    private Object data;

    @Override
    public String toString() {
        return "ResultData{" +
                "status='" + status + '\'' +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }

    /**
     * 状态和提示信息
     * @param status    状态
     * @param msg   提示信息
     * @return  resultData
     */
    public static ResultData getResultData(String status,String msg){
        ResultData resultData = new ResultData();
        resultData.setStatus(status);
        resultData.setMsg(msg);
        return resultData;
    }


    /**
     * 状态，提示信息，数据
     * @param status    状态
     * @param msg   提示信息
     * @param data  数据
     * @return resultData
     */
    public static ResultData getResultData(String status,String msg,Object data){
        return new ResultData(status,msg,data);
    }


}
